package com.wiseman.writing.utility.parsedata;

import java.io.InputStream;
import java.util.TreeMap;

public class Pinyin2312 extends TxtParser {

	TreeMap<Character, String> mPinYin2312 = new TreeMap<Character, String>();

	public Pinyin2312(String filename) {
		read(filename);
	}

	public Pinyin2312(InputStream in) {
		read(in);
	}

	@Override
	void processLine(String line) {

		String[] part = line.split(":");

		mPinYin2312.put(part[0].charAt(0), part[1]);

	}

	public String[] getPinYin(char c) {
		String[] pyArray = null;
		String pinyins = mPinYin2312.get(c);

		if (pinyins != null) {
			pyArray = pinyins.split(",");
		}

		return pyArray;

	}

	@Override
	void end() {
		super.end();
	}

}
